package com.mhc.suzuki.constant;

/**
 * 申请状态
 * Created by HMJ on 2017/9/28.
 */
public enum ApplyStatusEnum {
    // 正常
    NORMAL(0, "正常"),
    // 已撤回
    WITHDRAW(1, "已撤回"),
    // 已作废
    INVALID(-1, "已作废"),
    // 已完成
    COMPLETE(2, "已完成"),
    // 已拒绝
    CANCEL(3,"已拒绝");

    private Integer code;
    private String name;

    ApplyStatusEnum(Integer code, String name){
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getNameByCode(Integer code){
        for(ApplyStatusEnum item : ApplyStatusEnum.values()){
            if(item.getCode().equals(code)){
                return item.getName();
            }
        }
        return "";
    }

}
